-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Resolve SIGKILL and SIGINT errors on macOS #367
Conversation
759fb99
to
61f875e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This failed to run on MacOS (arm64).
I added what I saw from console, I don't know the cause at moment or a fix.
This should just be causing it to ignore (SIG_IGN) additional interrupt signals (SIGINT). In your log it is complaing about receiving a SIGKILL though, which seems odd. |
61f875e
to
4dafba2
Compare
@jwmatthews new attempt trying to handle this from the shell if you wouldn't mind testing. All this does is trap the SIGINT and send a SIGTERM to signal to gunicorn it should start a graceful shutdown rather than immediate.: If all goes well, you should see: instead of
Workers shoudl shutdown with [INFO] tag instead of [ERROR] as well. On Linux this looks like:
|
Makefile
Outdated
PYTHONPATH=$(KAI_PYTHON_PATH) python kai/server.py | ||
bash -c 'set -m; _trap () { kill -15 $$PID; } ; trap _trap SIGINT ;\ | ||
PYTHONPATH=$(KAI_PYTHON_PATH) python kai/server.py & export PID=$$! ;\ | ||
while kill -0 $$PID > /dev/null 2>&1; do wait $$PID; done' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"kill -0" sends no signal; it just checks for the pids existence. This loop just prevents the shell from exiting before the graceful shutdown is complete.
@jmontleon I updated to latest commit in this branch and saw immediate crash I see the below immediately when I try to run. I then did a CTRL-C and I saw another crash message from Mac pop up
|
The SIGKILL errors are addressed in #374 I can confirm the bash trap works to exit cleanly before the new SIGKILL issue, however with the dependency update that introduced the new problem and the workaround it seems no longer necessary. If we hit this again this will send a SIGTERM for graceful shutdown instead of SIGINT for quick shutdown:
|
8b5f4b6
to
cf9ad3d
Compare
Signed-off-by: Jason Montleon <jmontleo@redhat.com>
cf9ad3d
to
05d9d90
Compare
Looking good on MacOS in regard to running and automatically setting OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Note, I still see the odd crash when I CTRL-C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, this fixes the issue we recently saw where make run-server
would crash immediately on startup
No description provided.